# -*-coding=utf-8-*-
from django.db import models
from django.contrib.auth.models import User
from grades.models import ScholarClass

class Laptop(models.Model):
	laptop_id = models.CharField(verbose_name="Identificador do Laptop", max_length=200, primary_key=True)
	def __unicode__(self):
		return "Laptop \"" + self.laptop_id + "\""

class Person(User):
	class Meta:
		verbose_name = "Pessoa"
		verbose_name_plural = "Pessoal"
	enrollment_number = models.CharField(verbose_name="Matrícula",max_length=40)
	laptop = models.ForeignKey(Laptop, verbose_name="Laptop", null=True, blank=True)

class Employee(Person):
	class Meta:
		verbose_name = "Funcionário"
		verbose_name_plural = "Funcionários"	

class Teacher(Employee):
	class Meta:
		verbose_name = "Professor"
		verbose_name_plural = "Professores"
	scholar_classes = models.ManyToManyField(ScholarClass, verbose_name="Turmas", null=True, blank=True)

#class Principal(Teacher):
#	class Meta:
#		verbose_name = "Diretor"
#		verbose_name_plural = "Diretores" 

class Student(Person):
	class Meta:
		verbose_name = "Estudante"
		verbose_name_plural = "Estudantes"
	scholar_class = models.ForeignKey(ScholarClass, verbose_name="Turma", null=True, blank=True)
